package com.esri.core.ogc.wmts;

import com.esri.core.ags.LOD;
import com.esri.core.ags.TileInfo;
import com.esri.core.geometry.Point;
import com.esri.core.ogc.OwsDescription;
import org.codehaus.jackson.util.MinimalPrettyPrinter;

/* loaded from: classes.dex */
public class WMTSTileMatrix extends OwsDescription {
    private String a;
    private double b;
    private Point c;
    private boolean d;
    private int e;
    private int f;
    private int g;
    private int h;

    public WMTSTileMatrix() {
    }

    public WMTSTileMatrix(TileInfo tileInfo, LOD lod) {
        this.a = lod.getLevelValue();
        this.b = lod.getScale();
        this.c = tileInfo.getOrigin();
        this.e = tileInfo.getCols();
        this.f = tileInfo.getRows();
    }

    public String getIdentifier() {
        return this.a;
    }

    public double getScaleDenominator() {
        return this.b;
    }

    public Point getTopLeftCorner() {
        return this.c;
    }

    public int getTileWidth() {
        return this.e;
    }

    public int getTileHeight() {
        return this.f;
    }

    public int getMatrixWidth() {
        return this.g;
    }

    public int getMatrixHeight() {
        return this.h;
    }

    @Override // com.esri.core.ogc.OwsDescription, com.esri.core.ogc.OwsItem
    public void endElement(String str) {
        String currentTagName = getCurrentTagName();
        if ("Identifier".equals(currentTagName)) {
            a(this.mData.toString());
        } else if ("ScaleDenominator".equals(currentTagName)) {
            b(this.mData.toString());
        } else if ("TopLeftCorner".equals(currentTagName)) {
            c(this.mData.toString());
        } else if ("TileWidth".equals(currentTagName)) {
            d(this.mData.toString());
        } else if ("TileHeight".equals(currentTagName)) {
            e(this.mData.toString());
        } else if ("MatrixWidth".equals(currentTagName)) {
            f(this.mData.toString());
        } else if ("MatrixHeight".equals(currentTagName)) {
            g(this.mData.toString());
        }
        super.endElement(str);
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void a() {
        this.d = true;
    }

    private void a(String str) {
        if (str == null || str.length() <= 0) {
            return;
        }
        this.a = str;
    }

    private void b(String str) {
        if (str == null || str.length() <= 0) {
            return;
        }
        this.b = Double.parseDouble(str);
    }

    private void c(String str) {
        if (str == null || str.length() <= 0) {
            return;
        }
        String[] split = str.split(MinimalPrettyPrinter.DEFAULT_ROOT_VALUE_SEPARATOR);
        if (split.length > 1) {
            if (this.d) {
                this.c = new Point(Double.parseDouble(split[1]), Double.parseDouble(split[0]));
            } else {
                this.c = new Point(Double.parseDouble(split[0]), Double.parseDouble(split[1]));
            }
        }
    }

    private void d(String str) {
        if (str == null || str.length() <= 0) {
            return;
        }
        this.e = Integer.parseInt(str);
    }

    private void e(String str) {
        if (str == null || str.length() <= 0) {
            return;
        }
        this.f = Integer.parseInt(str);
    }

    private void f(String str) {
        if (str == null || str.length() <= 0) {
            return;
        }
        this.g = Integer.parseInt(str);
    }

    private void g(String str) {
        if (str == null || str.length() <= 0) {
            return;
        }
        this.h = Integer.parseInt(str);
    }
}
